package com.shanzmoo.core.domain.dto;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.module.msys.entity.MSysMenuEntity;
import com.shanzmoo.db.module.psys.entity.PSysMenuEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 系统菜单 保存对象
 *
 * @author： Gzhao 2021/3/29
 */
@Data
@ApiModel("系统菜单-更新对象")
public class SysMenuUpdateDTO extends SysMenuSaveDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "菜单ID")
    private Integer menuId;

    @Override
    public MSysMenuEntity convertM() {
        return JSON.parseObject(JSON.toJSONString(this), MSysMenuEntity.class);
    }

    @Override
    public PSysMenuEntity convertP() {
        PSysMenuEntity entity = JSON.parseObject(JSON.toJSONString(this), PSysMenuEntity.class);
        entity.setId(this.menuId);
        return entity;
    }
}
